﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Runtime.Serialization;
using System.Collections;
using System.Data;
using System.ComponentModel;
using System.Data.OracleClient;
using ReflectionStudio.Core.Events;
namespace INTEX.DataBase.Tools
{
    public partial class INTEXDBC
    {
        //WASTAMM WTSCHUSS WAFARBEN WTGEW WASTKE WASTGA BSSATZ BHSATZ BSGROE BSFARB BASTGA

        #region======A==============
        public DataSet QuerAPZUORD(DataRow dwData)
        {
            DataSet setReturn = new DataSet();
            DataSet Result = new DataSet();
            DataTable tbLocal = null;
            OracleCommand or1;
            // APZMANDANT  APZART APZVAR APZANRKRS APZALFDNR APZSTUFE

            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT * FROM APZUORD WHERE  "
            + "  APZMANDANT=:APZMANDANT AND APZART=:APZART AND APZVAR=:APZVAR AND APZANRKRS=:APZANRKRS AND "
            + "APZALFDNR=:APZALFDNR AND APZSTUFE=:APZSTUFE";
            or1.Parameters.Add("APZMANDANT", OracleType.NVarChar).Value = dwData["APZMANDANT"].ToString();
            or1.Parameters.Add("APZART", OracleType.NVarChar).Value = dwData["APZART"].ToString();
            or1.Parameters.Add("APZVAR", OracleType.NVarChar).Value = dwData["APZVAR"].ToString();
            or1.Parameters.Add("APZANRKRS", OracleType.NVarChar).Value = dwData["APZANRKRS"].ToString(); ;
            or1.Parameters.Add("APZALFDNR", OracleType.NVarChar).Value = dwData["APZALFDNR"].ToString();
            or1.Parameters.Add("APZSTUFE", OracleType.NVarChar).Value = dwData["APZSTUFE"].ToString();
            Result = Connect2Proxy(or1);
            if (Result.Tables.Count > 0)
            {
                tbLocal = Result.Tables[0];
                tbLocal.TableName = "APZUORD";
            }
            setReturn.Merge(Result);
            return setReturn;
        }
        public DataSet QueryBSSATZ(DataRow dwData)
        {
            DataSet setReturn = new DataSet();
            DataSet Result = new DataSet();
            DataTable tbLocal = null;
            OracleCommand or1;
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT * FROM  BSSATZ"
           + " WHERE "
            + " BSMANDANT=:BSMANDANT AND BSKART=:BSKART";
            or1.Parameters.Add("BSMANDANT", OracleType.NVarChar).Value = dwData["BSMANDANT"].ToString();
            or1.Parameters.Add("BSKART", OracleType.NVarChar).Value = dwData["BSKART"].ToString();
            Result = Connect2Proxy(or1);
            if (Result.Tables.Count > 0)
            {
                tbLocal = Result.Tables[0];
                tbLocal.TableName = "BSSATZ";
            }
            setReturn.Merge(Result);
            return setReturn;
        }
        public DataSet QueryBHSATZ(DataRow dwData)
        {
            DataSet setReturn = new DataSet();
            DataSet Result = new DataSet();
            DataTable tbLocal = null;
            OracleCommand or1;

            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT * FROM BHSATZ"
           + " WHERE BHMANDANT=:BHMANDANT AND BHKART=:BHKART AND BHKVAR=:BHKVAR";
            or1.Parameters.Add("BHMANDANT", OracleType.NVarChar).Value = dwData["BHMANDANT"].ToString();
            or1.Parameters.Add("BHKART", OracleType.NVarChar).Value = dwData["BHKART"].ToString();
            or1.Parameters.Add("BHKVAR", OracleType.NVarChar).Value = dwData["BHKVAR"].ToString();
            Result = Connect2Proxy(or1);
            if (Result.Tables.Count > 0)
            {
                tbLocal = Result.Tables[0];
                tbLocal.TableName = "BHSATZ";
            }
            setReturn.Merge(Result);
            return setReturn;
        }
        public DataSet QueryBSGROE(DataRow dwData)
        {
            DataSet setReturn = new DataSet();
            DataSet Result = new DataSet();
            DataTable tbLocal = null;
            OracleCommand or1;

            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT * FROM  BSGROE"
           + " WHERE "
            + " BSGMANDANT=:BSGMANDANT AND BSGART=:BSGART";
            or1.Parameters.Add("BSGMANDANT", OracleType.NVarChar).Value = dwData["BSGMANDANT"].ToString();
            or1.Parameters.Add("BSGART", OracleType.NVarChar).Value = dwData["BSGART"].ToString();
            Result = Connect2Proxy(or1);
            if (Result.Tables.Count > 0)
            {
                tbLocal = Result.Tables[0];
                tbLocal.TableName = "BSGROE";

            }
            setReturn.Merge(Result);
            return setReturn;
        }
        public DataSet QueryBSFARB(DataRow dwData)
        {
            DataSet setReturn = new DataSet();
            DataSet Result = new DataSet();
            DataTable tbLocal = null;
            OracleCommand or1;
            #region===========SELECT==========================
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT * FROM BSFARB"
           + " WHERE BSFMANDANT=:BSFMANDANT AND BSFKART=:BSFKART AND BSFKVAR=:BSFKVAR AND BSFKFARBE=:BSFKFARBE";
            or1.Parameters.Add("BSFMANDANT", OracleType.NVarChar).Value = dwData["BSFMANDANT"].ToString();
            or1.Parameters.Add("BSFKART", OracleType.NVarChar).Value = dwData["BSFKART"].ToString();
            or1.Parameters.Add("BSFKVAR", OracleType.NVarChar).Value = dwData["BSFKVAR"].ToString();
            or1.Parameters.Add("BSFKFARBE", OracleType.NVarChar).Value = dwData["BSFKFARBE"].ToString();
            Result = Connect2Proxy(or1);
            if (Result.Tables.Count > 0)
            {
                tbLocal = Result.Tables[0];
                tbLocal.TableName = "BSFARB";
            }
            #endregion
            setReturn.Merge(Result);
            return setReturn;
        }
        public DataSet QueryBASTGA(DataRow dwData)
        {
            DataSet setReturn = new DataSet();
            DataSet Result = new DataSet();
            DataTable tbLocal = null;
            OracleCommand or1;

            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT * FROM BASTGA WHERE  "
            + "  BAGMANDANT=:BAGMANDANT AND BAGART=:BAGART AND BAGVAR=:BAGVAR AND BAGFARBE=:BAGFARBE AND BAGPOS=:BAGPOS";
            or1.Parameters.Add("BAGMANDANT", OracleType.NVarChar).Value = dwData["BAGMANDANT"].ToString();
            or1.Parameters.Add("BAGART", OracleType.NVarChar).Value = dwData["BAGART"].ToString();
            or1.Parameters.Add("BAGVAR", OracleType.NVarChar).Value = dwData["BAGVAR"].ToString();
            or1.Parameters.Add("BAGFARBE", OracleType.NVarChar).Value = dwData["BAGFARBE"].ToString(); ;
            or1.Parameters.Add("BAGPOS", OracleType.NVarChar).Value = dwData["BAGPOS"].ToString(); ;
            Result = Connect2Proxy(or1);
            if (Result.Tables.Count > 0)
            {
                tbLocal = Result.Tables[0];
                tbLocal.TableName = "BASTGA";
            }
            setReturn.Merge(Result);
            return setReturn;
        }
        #endregion
        #region======B==============
        #endregion
        #region======C==============
        #endregion
        #region======D==============
        #endregion
        #region======E==============
        #endregion
        #region======F==============
        #endregion
        #region======G==============
        public DataSet QueryGSCOLOR(DataRow dwData)
        {
            DataSet setReturn = new DataSet();
            DataSet Result = new DataSet();
            DataTable tbLocal = null;
            OracleCommand or1;
            // GSCMANDANT GSCART GSCVAR GSCFARBE


            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT * FROM GSCOLOR WHERE  "
            + "  GSCMANDANT=:GSCMANDANT AND GSCART=:GSCART AND GSCVAR=:GSCVAR AND GSCFARBE=:GSCFARBE  ";
            or1.Parameters.Add("GSCMANDANT", OracleType.NVarChar).Value = dwData["GSCMANDANT"].ToString();
            or1.Parameters.Add("GSCART", OracleType.NVarChar).Value = dwData["GSCART"].ToString();
            or1.Parameters.Add("GSCVAR", OracleType.NVarChar).Value = dwData["GSCVAR"].ToString();
            or1.Parameters.Add("GSCFARBE", OracleType.NVarChar).Value = dwData["GSCFARBE"].ToString(); ;
            Result = Connect2Proxy(or1);
            if (Result.Tables.Count > 0)
            {
                tbLocal = Result.Tables[0];
                tbLocal.TableName = "GSCOLOR";
            }
            setReturn.Merge(Result);
            return setReturn;
        }

        #endregion
        #region======H==============
        #endregion
        #region======K==============
        public DataSet QueryKDSTAMM(DataRow dwData)
        {
            DataSet Return = new DataSet();
            DataTable tbLocal = null;
            DataSet Result = new DataSet();
            string table = "KDSTAMM";
            try
            {
                or1 = OracleDB.CreateCommand();

                or1.CommandText = "SELECT * FROM KDSTAMM WHERE  "
                + "  KDMANDANT=:KDMANDANT AND KDKUNDNR=:KDKUNDNR";
                or1.Parameters.Add("KDMANDANT", OracleType.NVarChar).Value = dwData["KDMANDANT"].ToString();
                or1.Parameters.Add("KDKUNDNR", OracleType.NVarChar).Value = dwData["KDKUNDNR"].ToString();
                Result = Connect2Proxy(or1);
                if (Result.Tables.Count > 0)
                {
                    tbLocal = Result.Tables[0];
                    tbLocal.TableName = "KDSTAMM";
                }
                Return.Merge(Result);
            }
            catch (Exception ex)
            {
                Tracer.Error(ex.StackTrace, ex);
            }
            return Return;
        }
        public DataSet QueryKDSTAMM(DataRow dwData, int option = 1)
        {
            DataSet Return = new DataSet();
            DataTable tbLocal = null;
            DataSet Result = new DataSet();
            string table = "KDSTAMM";
            try
            {
                or1 = OracleDB.CreateCommand();
                switch (option)
                {
                    case 1:
                        or1.CommandText = "SELECT KDMANDANT,KDKUNDNR,KDKUNDNA FROM KDSTAMM WHERE KDMANDANT=:KDMANDANT";
                        or1.Parameters.Add("KDMANDANT", OracleType.NVarChar).Value = dwData["KDMANDANT"].ToString();
                        break;
                    default:
                        break;
                }
                Result = Connect2Proxy(or1);
                if (Result.Tables.Count > 0)
                {
                    tbLocal = Result.Tables[0];
                    tbLocal.TableName = "KDSTAMM";
                }
                Return.Merge(Result);
            }
            catch (Exception ex)
            {
                Tracer.Error(ex.StackTrace, ex);
            }
            return Return;
        }
        public DataSet QueryKUNDVER(DataRow dwData, int option = 1)
        {
            DataSet Return = new DataSet();
            DataTable tbLocal = null;
            DataSet Result = new DataSet();
            string table = "KUNDVER";
            try
            {
                or1 = OracleDB.CreateCommand();
                switch (option)
                {
                    case 2:
                        or1.CommandText = "SELECT * FROM KUNDVER WHERE  "
                            + "  KDVMANDANT=:KDVMANDANT AND KDVKUNDNR=:KDVKUNDNR";
                        or1.Parameters.Add("KDVMANDANT", OracleType.NVarChar).Value = dwData["KDVMANDANT"].ToString();
                        or1.Parameters.Add("KDVKUNDNR", OracleType.NVarChar).Value = dwData["KDVKUNDNR"].ToString();
                        break;
                    case 1:
                    default:
                        or1.CommandText = "SELECT * FROM KUNDVER WHERE  "
                            + "  KDVMANDANT=:KDVMANDANT AND KDVKUNDNR=:KDVKUNDNR AND KDVVB=:KDVVB AND KDVVG=:KDVVG";
                        or1.Parameters.Add("KDVMANDANT", OracleType.NVarChar).Value = dwData["KDVMANDANT"].ToString();
                        or1.Parameters.Add("KDVKUNDNR", OracleType.NVarChar).Value = dwData["KDVKUNDNR"].ToString();
                        or1.Parameters.Add("KDVVB", OracleType.NVarChar).Value = dwData["KDVVB"].ToString();
                        or1.Parameters.Add("KDVVG", OracleType.NVarChar).Value = dwData["KDVVG"].ToString();
                        break;
                }

                Result = Connect2Proxy(or1);
                if (Result.Tables.Count > 0)
                {
                    tbLocal = Result.Tables[0];
                    tbLocal.TableName = "KUNDVER";
                }
                Return.Merge(Result);
            }
            catch (Exception ex)
            {
                Tracer.Error(ex.StackTrace, ex);
            }
            return Return;
        }
        #endregion
        #region======L==============
        #endregion
        #region======M==============
        #endregion
        #region======P==============
        #endregion
        #region======Q==============
        #endregion
        #region======S==============
        public DataSet QuerySDDAT(DataRow dwSDDAT)
        {
            DataSet set4Return = new DataSet();
            DataSet Result = new DataSet();
            OracleCommand or1 = OracleDB.CreateCommand();
            //0109
            or1 = OracleDB.CreateCommand();

            or1.CommandText = " SELECT * FROM SDDAT WHERE SDSA=:SDSA AND SDKEY =:SDKEY";
            or1.Parameters.Add("SDSA", OracleType.NVarChar).Value = dwSDDAT["SDSA"];
            or1.Parameters.Add("SDKEY", OracleType.NVarChar).Value = dwSDDAT["SDKEY"];

            Result = Connect2Proxy(or1);
            if (Result.Tables[0].Rows.Count > 0)
            {
                set4Return.Merge(Result);
            }
            return set4Return;
        }
        #endregion
        #region======W==============
        //WDECK WBBST WBBEW VVLIEF VVTLIEF
        public DataSet QueryWASTPASS(DataRow dwData)
        {
            DataSet set4Return = new DataSet();
            DataSet Result = new DataSet();
            DataTable tbLocal = null;
            DataRow dwLocal = null;
            OracleCommand or1;

            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT *FROM WASTPASS WHERE   "
            + "  WSPMANDANT=:WSPMANDANT AND WSPART=:WSPART AND WSPVAR=:WSPVAR";
            or1.Parameters.Add("WSPMANDANT", OracleType.NVarChar).Value = dwData["WSPMANDANT"].ToString();
            or1.Parameters.Add("WSPART", OracleType.NVarChar).Value = dwData["WSPART"].ToString();
            or1.Parameters.Add("WSPVAR", OracleType.NVarChar).Value = dwData["WSPVAR"].ToString();
            Result = Connect2Proxy(or1);
            if (Result.Tables.Count > 0)
            {
                tbLocal = Result.Tables[0];
                tbLocal.TableName = "WASTPASS";
            }
            set4Return.Merge(Result);
            return set4Return;
        }
        public DataSet QueryWASTKE(DataRow dwData)
        {
            DataSet setReturn = new DataSet();
            DataSet Result = new DataSet();
            DataTable tbLocal = null;
            OracleCommand or1;
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT * FROM WASTKE"
           + " WHERE WAKMANDANT=:WAKMANDANT AND WAKART=:WAKART AND WAKVAR=:WAKVAR AND WAKWCOL=:WAKWCOL";
            or1.Parameters.Add("WAKMANDANT", OracleType.NVarChar).Value = dwData["WAKMANDANT"].ToString();
            or1.Parameters.Add("WAKART", OracleType.NVarChar).Value = dwData["WAKART"].ToString();
            or1.Parameters.Add("WAKVAR", OracleType.NVarChar).Value = dwData["WAKVAR"].ToString();
            or1.Parameters.Add("WAKWCOL", OracleType.NVarChar).Value = dwData["WAKWCOL"].ToString();

            Result = Connect2Proxy(or1);
            if (Result.Tables.Count > 0)
            {
                tbLocal = Result.Tables[0];
                tbLocal.TableName = "WASTKE";
            }
            setReturn.Merge(Result);
            return setReturn;
        }
        public DataSet QueryWASTGA(DataRow dwData)
        {
            DataSet setReturn = new DataSet();
            DataSet Result = new DataSet();
            DataTable tbLocal = null;
            OracleCommand or1;

            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT * FROM WASTGA WHERE  "
            + "  WAGMANDANT=:WAGMANDANT AND WAGART=:WAGART AND WAGVAR=:WAGVAR AND WAGWCOL=:WAGWCOL AND WAGPOS=:WAGPOS AND WAGFOLGEPOS=:WAGFOLGEPOS";
            or1.Parameters.Add("WAGMANDANT", OracleType.NVarChar).Value = dwData["WAGMANDANT"].ToString();
            or1.Parameters.Add("WAGART", OracleType.NVarChar).Value = dwData["WAGART"].ToString();
            or1.Parameters.Add("WAGVAR", OracleType.NVarChar).Value = dwData["WAGVAR"].ToString();
            or1.Parameters.Add("WAGWCOL", OracleType.NVarChar).Value = dwData["WAGWCOL"].ToString(); ;
            or1.Parameters.Add("WAGPOS", OracleType.NVarChar).Value = dwData["WAGPOS"].ToString(); ;
            or1.Parameters.Add("WAGFOLGEPOS", OracleType.Number).Value = dwData["WAGFOLGEPOS"].ToString();

            Result = Connect2Proxy(or1);
            if (Result.Tables.Count > 0)
            {
                tbLocal = Result.Tables[0];
                tbLocal.TableName = "WASTGA";
            }

            setReturn.Merge(Result);
            return setReturn;
        }
        public DataSet QueryWTSCHUSS(DataRow dwData)
        {
            DataSet setReturn = new DataSet();
            DataSet Result = new DataSet();
            DataTable tbLocal = null;
            OracleCommand or1;
            try
            {
                or1 = OracleDB.CreateCommand();
                or1.CommandText = "SELECT * FROM WTSCHUSS WHERE WTSMANDANT=:WTSMANDANT AND WTSSFLGNR=:WTSSFLGNR";
                or1.Parameters.Add("WTSMANDANT", OracleType.NVarChar).Value = dwData["WTSMANDANT"].ToString();
                or1.Parameters.Add("WTSSFLGNR", OracleType.NVarChar).Value = dwData["WTSSFLGNR"].ToString();
                Result = Connect2Proxy(or1);
                if (Result.Tables.Count > 0)
                {
                    tbLocal = Result.Tables[0];
                    tbLocal.TableName = "WTSCHUSS";
                }
                setReturn.Merge(Result);
            }
            catch (Exception ex)
            {
                Tracer.Error(ex.StackTrace, ex);
            }
            return setReturn;
        }
        public DataSet QueryWAFARBEN(DataRow dwData)
        {
            DataSet setReturn = new DataSet();
            DataSet Result = new DataSet();
            DataTable tbLocal = null;
            OracleCommand or1;
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT * FROM WAFARBEN WHERE   "
            + "  WAFMANDANT=:WAFMANDANT AND WAFART=:WAFART AND WAFVAR=:WAFVAR AND WAFZUART=:WAFZUART AND WAFZUSATZ=:WAFZUSATZ ";
            or1.Parameters.Add("WAFMANDANT", OracleType.NVarChar).Value = dwData["WAFMANDANT"].ToString();
            or1.Parameters.Add("WAFART", OracleType.NVarChar).Value = dwData["WAFART"].ToString();
            or1.Parameters.Add("WAFVAR", OracleType.NVarChar).Value = dwData["WAFVAR"].ToString();
            or1.Parameters.Add("WAFZUART", OracleType.NVarChar).Value = dwData["WAFZUART"].ToString();
            or1.Parameters.Add("WAFZUSATZ", OracleType.NVarChar).Value = dwData["WAFZUSATZ"].ToString();

            Result = Connect2Proxy(or1);

            if (Result.Tables.Count > 0)
            {
                tbLocal = Result.Tables[0];
                tbLocal.TableName = "WAFARBEN";
            }
            setReturn.Merge(Result);
            return setReturn;
        }
        public DataSet QueryWASTAMM(DataRow dwData)
        {
            DataSet setReturn = new DataSet();
            DataSet Result = new DataSet();
            DataTable tbLocal = null;
            OracleCommand or1;
            try
            {
                or1 = OracleDB.CreateCommand();
                or1.CommandText = "SELECT * FROM WASTAMM WHERE  "
                + "  WAMANDANT=:WAMANDANT AND WAART=:WAART AND WAVAR=:WAVAR";
                or1.Parameters.Add("WAMANDANT", OracleType.NVarChar).Value = dwData["WAMANDANT"].ToString();
                or1.Parameters.Add("WAART", OracleType.NVarChar).Value = dwData["WAART"].ToString();
                or1.Parameters.Add("WAVAR", OracleType.NVarChar).Value = dwData["WAVAR"].ToString();

                Result = Connect2Proxy(or1);
                if (Result.Tables.Count > 0)
                {
                    tbLocal = Result.Tables[0];
                    tbLocal.TableName = "WASTAMM";
                }
                setReturn.Merge(Result);
            }
            catch (Exception ex)
            {
                Tracer.Error(ex.StackTrace, ex);
            }
            return setReturn;
        }
        public DataSet QueryWBBST(DataRow dwData)
        {
            DataSet Return;
            DataSet Result = new DataSet();
            OracleCommand or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT * FROM WBBST "
                + " WHERE WBBMANDANT=:WBBMANDANT and WBBRWKRS=:WBBRWKRS AND WBBRWLFD=:WBBRWLFD AND WBBPOS=:WBBPOS";
            or1.Parameters.Add("WBBMANDANT", OracleType.NVarChar).Value = dwData["WBBMANDANT"].ToString();
            or1.Parameters.Add("WBBRWKRS", OracleType.NVarChar).Value = dwData["WBBRWKRS"].ToString();
            or1.Parameters.Add("WBBRWLFD", OracleType.NVarChar).Value = dwData["WBBRWLFD"].ToString();
            or1.Parameters.Add("WBBPOS", OracleType.NVarChar).Value = dwData["WBBPOS"].ToString();
            Result = Connect2Proxy(or1);
            if (Result.Tables.Count > 0)
                Result.Tables[0].TableName = "WBBST";
            Return = Result;
            return Return;
        }
        public DataSet QueryWBBST(DataRow dwData, int option)
        {
            DataSet Return;
            DataSet Result = new DataSet();
            string qty = "0";
            OracleCommand or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 1:
                    qty = dwData["WBBISTKLG"].ToString();
                    or1.CommandText = "SELECT * FROM WBBST WHERE WBBMANDANT=:WBBMANDANT "
              + " AND WBBDISPOART=:WBBDISPOART "
              + " AND WBBDISPOVAR=:WBBDISPOVAR "
              + " AND WBBWAKZ=:WBBWAKZ "
              + " AND WBBLO=:WBBLO "
                        //              + " AND WBBLB=:WBBLB "
              + " AND WBBDESS=:WBBDESS "
              + " AND WBBCOLORIT=:WBBCOLORIT "
              + " AND WBBBESCHICH=:WBBBESCHICH "
              + " AND WBBFARBE=:WBBFARBE "
              + " AND WBBAUFLFD='000000'"
              + " AND WBBISTKLG-WBBTSTKLG>=" + qty
              + " ORDER BY WBBSSTKLG ASC";
                    or1.Parameters.Add("WBBMANDANT", OracleType.NVarChar).Value = dwData["WBBMANDANT"].ToString();
                    or1.Parameters.Add("WBBDISPOART", OracleType.NVarChar).Value = dwData["WBBDISPOART"].ToString();
                    or1.Parameters.Add("WBBDISPOVAR", OracleType.NVarChar).Value = dwData["WBBDISPOVAR"].ToString();
                    or1.Parameters.Add("WBBWAKZ", OracleType.NVarChar).Value = dwData["WBBWAKZ"].ToString();
                    or1.Parameters.Add("WBBLO", OracleType.NVarChar).Value = dwData["WBBLO"].ToString();
                    //or1.Parameters.Add("WBBLB", OracleType.NVarChar).Value = dwData["WBBLB"].ToString();
                    or1.Parameters.Add("WBBDESS", OracleType.NVarChar).Value = dwData["WBBDESS"].ToString();
                    or1.Parameters.Add("WBBCOLORIT", OracleType.NVarChar).Value = dwData["WBBCOLORIT"].ToString();
                    or1.Parameters.Add("WBBBESCHICH", OracleType.NVarChar).Value = dwData["WBBBESCHICH"].ToString();
                    or1.Parameters.Add("WBBFARBE", OracleType.NVarChar).Value = dwData["WBBFARBE"].ToString();
                    break;
                case 2:
                    or1.CommandText = "SELECT * FROM WBBST WHERE WBBMANDANT=:WBBMANDANT "
                        + " AND WBBDISPOART=:WBBDISPOART "
                        + " AND WBBDISPOVAR=:WBBDISPOVAR "
                        + " AND WBBWAKZ=:WBBWAKZ "
                        + " AND WBBLO=:WBBLO "
                        // + " AND WBBLB=:WBBLB "                        
                        + " AND WBBDESS=:WBBDESS "
                        + " AND WBBCOLORIT=:WBBCOLORIT "
                        + " AND WBBBESCHICH=:WBBBESCHICH "
                        + " AND WBBFARBE=:WBBFARBE "
                        + " AND WBBAUFLFD='000000'"
                        + " ORDER BY WBBSSTKLG ASC";
                    or1.Parameters.Add("WBBMANDANT", OracleType.NVarChar).Value = dwData["WBBMANDANT"].ToString();
                    or1.Parameters.Add("WBBDISPOART", OracleType.NVarChar).Value = dwData["WBBDISPOART"].ToString();
                    or1.Parameters.Add("WBBDISPOVAR", OracleType.NVarChar).Value = dwData["WBBDISPOVAR"].ToString();
                    or1.Parameters.Add("WBBWAKZ", OracleType.NVarChar).Value = dwData["WBBWAKZ"].ToString();
                    or1.Parameters.Add("WBBLO", OracleType.NVarChar).Value = dwData["WBBLO"].ToString();
                    //or1.Parameters.Add("WBBLB", OracleType.NVarChar).Value = dwData["WBBLB"].ToString();
                    or1.Parameters.Add("WBBDESS", OracleType.NVarChar).Value = dwData["WBBDESS"].ToString();
                    or1.Parameters.Add("WBBCOLORIT", OracleType.NVarChar).Value = dwData["WBBCOLORIT"].ToString();
                    or1.Parameters.Add("WBBBESCHICH", OracleType.NVarChar).Value = dwData["WBBBESCHICH"].ToString();
                    or1.Parameters.Add("WBBFARBE", OracleType.NVarChar).Value = dwData["WBBFARBE"].ToString();
                    break;
                default:
                    break;
            }

            Result = Connect2Proxy(or1);
            if (Result.Tables.Count > 0)
                Result.Tables[0].TableName = "WBBST";
            Return = Result;
            return Return;
        }
        public DataSet QueryWDECK(DataRow dwData)
        {
            DataSet Return;
            DataSet Result = new DataSet();
            OracleCommand or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT * FROM WDECK  "
            + " WHERE WDMANDANT=:WDMANDANT AND WDTYP='B' AND WDAUFKRS=:WDAUFKRS  AND WDAUFLFD=:WDAUFLFD AND WDAUFPOS=:WDAUFPOS";
            or1.Parameters.Add("WDMANDANT", OracleType.NVarChar).Value = dwData["WDMANDANT"].ToString();
            or1.Parameters.Add("WDAUFKRS", OracleType.NVarChar).Value = dwData["WDAUFKRS"].ToString();
            or1.Parameters.Add("WDAUFLFD", OracleType.NVarChar).Value = dwData["WDAUFLFD"].ToString();
            or1.Parameters.Add("WDAUFPOS", OracleType.NVarChar).Value = dwData["WDAUFPOS"].ToString();
            Result = Connect2Proxy(or1);
            if (Result.Tables.Count > 0)
                Result.Tables[0].TableName = "WDECK";
            Return = Result;
            return Return;
        }
        public DataSet QueryWDECK(DataRow dwData, int option)
        {
            DataSet Return;
            DataSet Result = new DataSet();
            OracleCommand or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 2:
                    or1.CommandText = "SELECT * FROM WDECK  "
                    + " WHERE WDMANDANT=:WDMANDANT AND WDTYP='B' AND WDART=:WDART  AND WDFARBE=:WDFARBE";
                    or1.Parameters.Add("WDMANDANT", OracleType.NVarChar).Value = dwData["WDMANDANT"].ToString();
                    or1.Parameters.Add("WDART", OracleType.NVarChar).Value = dwData["WDART"].ToString();
                    or1.Parameters.Add("WDFARBE", OracleType.NVarChar).Value = dwData["WDFARBE"].ToString();
                    break;
                default:
                    break;
            }
            Result = Connect2Proxy(or1);
            if (Result.Tables.Count > 0)
                Result.Tables[0].TableName = "WDECK";
            Return = Result;
            return Return;
        }
        public DataSet QueryWBDAT(DataRow dwData)
        {
            DataSet Return;
            DataSet Result = new DataSet();
            OracleCommand or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT * FROM WBDAT WHERE WBMANDANT=:WBMANDANT "
            + "AND WBRWKRS=:WBRWKRS AND WBRWLFD=:WBRWLFD ";
            or1.Parameters.Add("WBMANDANT", OracleType.NVarChar).Value = dwData["WBMANDANT"].ToString();
            or1.Parameters.Add("WBRWKRS", OracleType.NVarChar).Value = dwData["WBRWKRS"].ToString();
            or1.Parameters.Add("WBRWLFD", OracleType.NVarChar).Value = dwData["WBRWLFD"].ToString();
            Result = Connect2Proxy(or1);
            if (Result.Tables.Count > 0)
                Result.Tables[0].TableName = "WBDAT";
            Return = Result;
            return Return;
        }
        public DataSet QueryWBBEW(DataRow dwData)
        {
            DataSet Return;
            DataSet Result = new DataSet();
            OracleCommand or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT * FROM WBBEW WHERE WBEWMANDANT=:WBEWMANDANT AND WBEWBELEG=:WBEWBELEG AND WBEWLFDNR=:WBEWLFDNR ";
            or1.Parameters.Add("WBEWMANDANT", OracleType.NVarChar).Value = dwData["WBEWMANDANT"].ToString();
            or1.Parameters.Add("WBEWBELEG", OracleType.NVarChar).Value = dwData["WBEWBELEG"].ToString();
            or1.Parameters.Add("WBEWLFDNR", OracleType.NVarChar).Value = dwData["WBEWLFDNR"].ToString();
            Result = Connect2Proxy(or1);
            if (Result.Tables.Count > 0)
                Result.Tables[0].TableName = "WBBEW";
            Return = Result;
            return Return;
        }
        /// <summary>
        /// option==1, 获取最大的WBEWBELEG
        /// </summary>
        /// <param name="dwData"></param>
        /// <param name="option"></param>
        /// <returns></returns>
        public DataSet QueryWBBEW(DataRow dwData, int option)
        {
            DataSet Return;
            DataSet Result = new DataSet();
            OracleCommand or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 1:
                    or1.CommandText = "SELECT MAX(WBEWBELEG) AS WBEWBELEG FROM WBBEW ";
                    break;
                case 2:
                    or1.CommandText = "SELECT WBEWSTKNR,Sum(WBEWMTR) AS TBCM from wbbew  "
                    + " where  WBEWMANDANT=:WBEWMANDANT AND WBEWSTKNR = :WBEWSTKNR and WBEWBS=64 group by WBEWSTKNR ";
                    or1.Parameters.Add("WBEWMANDANT", OracleType.NVarChar).Value = dwData["WBBMANDANT"].ToString();
                    or1.Parameters.Add("WBEWSTKNR", OracleType.NVarChar).Value = dwData["WBBSTKNR"].ToString();
                    break;
                default:
                    break;
            }
            Result = Connect2Proxy(or1);
            if (Result.Tables.Count > 0)
                Result.Tables[0].TableName = "WBBEW";
            Return = Result;
            return Return;
        }

        public DataSet QueryWGBST(DataRow dwData, int option)
        {
            DataSet Return;
            DataSet Result = new DataSet();
            OracleCommand or1 = OracleDB.CreateCommand();
            if (option == 1)
            {
                or1.CommandText = "SELECT * FROM WGBST WHERE "
                    + "  WGMANDANT=:WGMANDANT AND WGWAKZ=:WGWAKZ AND WGART=:WGART AND WGVAR=:WGVAR"
                    + "  AND WGFARBE=:WGFARBE AND WGBESCHICH=:WGBESCHICH AND WGDESS=:WGDESS AND WGCOLORIT=:WGCOLORIT"
                    + "   AND WGLO=:WGLO"
                    + " ORDER BY WGMJJ DESC,WGMM DESC ";
                or1.Parameters.Add("WGMANDANT", OracleType.NVarChar).Value = dwData["WGMANDANT"].ToString();
                or1.Parameters.Add("WGWAKZ", OracleType.NVarChar).Value = dwData["WGWAKZ"].ToString();
                or1.Parameters.Add("WGART", OracleType.NVarChar).Value = dwData["WGART"].ToString();
                or1.Parameters.Add("WGVAR", OracleType.NVarChar).Value = dwData["WGVAR"].ToString();
                or1.Parameters.Add("WGFARBE", OracleType.NVarChar).Value = dwData["WGFARBE"].ToString();
                or1.Parameters.Add("WGBESCHICH", OracleType.NVarChar).Value = dwData["WGBESCHICH"].ToString();
                or1.Parameters.Add("WGDESS", OracleType.NVarChar).Value = dwData["WGDESS"].ToString();
                or1.Parameters.Add("WGCOLORIT", OracleType.NVarChar).Value = dwData["WGCOLORIT"].ToString();
                or1.Parameters.Add("WGLO", OracleType.NVarChar).Value = dwData["WGLO"].ToString();
            }
            Result = Connect2Proxy(or1);
            if (Result.Tables.Count > 0)
                Result.Tables[0].TableName = "WGBST";
            Return = Result;
            return Return;
        }
        public DataSet QueryWTEINZ(DataRow dwData)
        {
            DataSet set4Return = new DataSet();
            DataSet Result = new DataSet();
            DataTable tbLocal = null;
            OracleCommand or1;
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT *FROM  WTEINZ "
                + "  WHERE WTEMANDANT=:WTEMANDANT AND WTEEINZNR=:WTEEINZNR";
            or1.Parameters.Add("WTEMANDANT", OracleType.NVarChar).Value = dwData["WTEMANDANT"].ToString();
            or1.Parameters.Add("WTEEINZNR", OracleType.NVarChar).Value = dwData["WTEEINZNR"].ToString();
            Result = Connect2Proxy(or1);
            if (Result.Tables.Count > 0)
            {
                tbLocal = Result.Tables[0];
                tbLocal.TableName = "WTEINZ";
            }
            set4Return.Merge(Result);
            return set4Return;
        }
        public DataSet QueryWTPASS(DataRow dwData)
        {
            DataSet set4Return = new DataSet();
            DataSet Result = new DataSet();
            DataTable tbLocal = null;
            OracleCommand or1;
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT *FROM WTPASS WHERE   "
            + "  WTPMANDANT=:WTPMANDANT AND WTPPASSNR=:WTPPASSNR";
            or1.Parameters.Add("WTPMANDANT", OracleType.NVarChar).Value = dwData["WTPMANDANT"].ToString();
            or1.Parameters.Add("WTPPASSNR", OracleType.NVarChar).Value = dwData["WTPPASSNR"].ToString();
            Result = Connect2Proxy(or1);
            if (Result.Tables.Count > 0)
            {
                tbLocal = Result.Tables[0];
                tbLocal.TableName = "WTPASS";
            }
            set4Return.Merge(Result);
            return set4Return;
        }
        public DataSet QueryWTGEW(DataRow dwData)
        {
            DataSet setReturn = new DataSet();
            DataSet Result = new DataSet();
            DataTable tbLocal = null;
            OracleCommand or1;
            //select * from WTGEW where WTGART='PV912102            ' AND WTGVAR='12'

            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT * FROM WTGEW WHERE   "
            + "  WTGMANDANT=:WTGMANDANT AND WTGART=:WTGART AND WTGVAR=:WTGVAR";
            or1.Parameters.Add("WTGMANDANT", OracleType.NVarChar).Value = dwData["WTGMANDANT"].ToString();
            or1.Parameters.Add("WTGART", OracleType.NVarChar).Value = dwData["WTGART"].ToString();
            or1.Parameters.Add("WTGVAR", OracleType.NVarChar).Value = dwData["WTGVAR"].ToString();
            Result = Connect2Proxy(or1);
            if (Result.Tables.Count > 0)
            {
                tbLocal = Result.Tables[0];
                tbLocal.TableName = "WTGEW";
            }
            setReturn.Merge(Result);
            return setReturn;
        }
        public DataSet QueryWTSAER(DataRow dwData)
        {
            DataSet setReturn = new DataSet();
            DataSet Result = new DataSet();
            DataTable tbLocal = null;
            OracleCommand or1;
            //select * from WTGEW where WTGART='PV912102            ' AND WTGVAR='12'

            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT * FROM WTSAER WHERE   "
            + "  WTBMANDANT=:WTBMANDANT AND WTBSRFNR=:WTBSRFNR";
            or1.Parameters.Add("WTBMANDANT", OracleType.NVarChar).Value = dwData["WTBMANDANT"].ToString();
            or1.Parameters.Add("WTBSRFNR", OracleType.NVarChar).Value = dwData["WTBSRFNR"].ToString();
            Result = Connect2Proxy(or1);
            if (Result.Tables.Count > 0)
            {
                tbLocal = Result.Tables[0];
                tbLocal.TableName = "WTSAER";
            }
            setReturn.Merge(Result);
            return setReturn;
        }
        #endregion
        #region======V==============
        public DataSet QueryVAART(DataRow dwData)
        {
            DataSet Return;
            DataSet Result = new DataSet();
            OracleCommand or1 = OracleDB.CreateCommand();
            or1.CommandText = " SELECT * FROM VAART WHERE ROWNUM<2 AND VAAMANDANT=:VAAMANDANT"
                + "  AND VAAKOLL=:VAAKOLL AND VAAART =:VAAART"
            ;
            or1.Parameters.Add("VAAMANDANT", OracleType.NVarChar).Value = dwData["VAAMANDANT"].ToString();
            or1.Parameters.Add("VAAKOLL", OracleType.NVarChar).Value = dwData["VAAKOLL"].ToString();
            or1.Parameters.Add("VAAART", OracleType.NVarChar).Value = dwData["VAAART"].ToString();

            Result = Connect2Proxy(or1);
            if (Result.Tables.Count > 0)
                Result.Tables[0].TableName = "VAART";
            Return = Result;
            return Return;
        }
        public DataSet QueryVAART(DataRow dwData, int option)
        {
            DataSet Return;
            DataSet Result = new DataSet();
            OracleCommand or1 = OracleDB.CreateCommand();
            if (option == 1)
            {
                string VAAART = dwData["VAAART"].ToString().Trim();
                string VAAKOLL = dwData["VAAKOLL"].ToString().Trim();
                or1.CommandText = " SELECT VAAMANDANT,VAAKOLL,VAAART,VAABEZ,VAAARTST" +
                    " FROM VAART WHERE VAAMANDANT=:VAAMANDANT AND VAAART LIKE '%" + VAAART + "%'"
                    //+ "  AND VAAKOLL LIKE '%"+VAAKOLL+"%' AND VAAART LIKE '%" + VAAART + "%'"
                    //+ "  AND VAAKOLL=:VAAKOLL AND VAAART LIKE '%" + VAAART + "%'"
                ;
                or1.Parameters.Add("VAAMANDANT", OracleType.NVarChar).Value = dwData["VAAMANDANT"].ToString();
                //or1.Parameters.Add("VAAKOLL", OracleType.NVarChar).Value = dwData["VAAKOLL"].ToString();
            }
            if (option == 2)
            {
                string VAAART = dwData["VAAART"].ToString().Trim();
                or1.CommandText = " SELECT * FROM VAART WHERE VAAMANDANT=:VAAMANDANT"
                + "  AND VAAART =:VAAART"
                ;
                or1.Parameters.Add("VAAMANDANT", OracleType.NVarChar).Value = dwData["VAAMANDANT"].ToString();
                or1.Parameters.Add("VAAART", OracleType.NVarChar).Value = dwData["VAAART"].ToString();
            }
            Result = Connect2Proxy(or1);
            if (Result.Tables.Count > 0)
                Result.Tables[0].TableName = "VAART";
            Return = Result;
            return Return;
        }
        public DataSet QueryVAFARBEN(DataRow dwData)
        {
            DataSet Return;
            DataSet Result = new DataSet();
            OracleCommand or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT * FROM VAFARBEN  WHERE VAFMANDANT=:VAFMANDANT"
            + " AND VAFKOLL=:VAFKOLL AND VAFART =:VAFART AND VAFFARBE=:VAFFARBE"
            ;
            or1.Parameters.Add("VAFMANDANT", OracleType.NVarChar).Value = dwData["VAFMANDANT"].ToString();
            or1.Parameters.Add("VAFKOLL", OracleType.NVarChar).Value = dwData["VAFKOLL"].ToString();
            or1.Parameters.Add("VAFART", OracleType.NVarChar).Value = dwData["VAFART"].ToString();
            or1.Parameters.Add("VAFFARBE", OracleType.NVarChar).Value = dwData["VAFFARBE"].ToString();
            Result = Connect2Proxy(or1);
            if (Result.Tables.Count > 0)
                Result.Tables[0].TableName = "VAFARBEN";
            Return = Result;
            return Return;
        }
        public DataSet QueryVAFARBEN(DataRow dwData, int option)
        {
            DataSet Return;
            DataSet Result = new DataSet();
            OracleCommand or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 1:
                    or1.CommandText = "SELECT * FROM VAFARBEN  WHERE  VAFMANDANT=:VAFMANDANT"
                        + " AND VAFKOLL=:VAFKOLL AND VAFART =:VAFART";
                    or1.Parameters.Add("VAFMANDANT", OracleType.NVarChar).Value = dwData["VAFMANDANT"].ToString();
                    or1.Parameters.Add("VAFKOLL", OracleType.NVarChar).Value = dwData["VAFKOLL"].ToString();
                    or1.Parameters.Add("VAFART", OracleType.NVarChar).Value = dwData["VAFART"].ToString();
                    break;
                case 2:
                    or1.CommandText = "SELECT * FROM VAFARBEN  WHERE  VAFMANDANT=:VAFMANDANT"
                        + " AND VAFKOLL=:VAFKOLL AND VAFART =:VAFART AND VAFFARBE=:VAFFARBE";
                    or1.Parameters.Add("VAFMANDANT", OracleType.NVarChar).Value = dwData["VAFMANDANT"].ToString();
                    or1.Parameters.Add("VAFKOLL", OracleType.NVarChar).Value = dwData["VAFKOLL"].ToString();
                    or1.Parameters.Add("VAFART", OracleType.NVarChar).Value = dwData["VAFART"].ToString();
                    or1.Parameters.Add("VAFFARBE", OracleType.NVarChar).Value = dwData["VAFFARBE"].ToString();
                    break;
                default:
                    break;
            }
            Result = Connect2Proxy(or1);
            if (Result.Tables.Count > 0)
                Result.Tables[0].TableName = "VAFARBEN";
            Return = Result;
            return Return;
        }
        public DataSet QueryVKKOPF(DataRow dwData)
        {
            DataSet Return = new DataSet();
            DataTable tbLocal = null;
            DataSet Result = new DataSet();
            string table = "VKKOPF";

            or1 = OracleDB.CreateCommand();

            or1.CommandText = "SELECT * FROM VKKOPF WHERE  "
            + "  VKKMANDANT=:VKKMANDANT AND VKKAUFKRS=:VKKAUFKRS AND VKKAUFLFD=:VKKAUFLFD";
            or1.Parameters.Add("VKKMANDANT", OracleType.NVarChar).Value = dwData["VKKMANDANT"].ToString();
            or1.Parameters.Add("VKKAUFKRS", OracleType.NVarChar).Value = dwData["VKKAUFKRS"].ToString();
            or1.Parameters.Add("VKKAUFLFD", OracleType.NVarChar).Value = dwData["VKKAUFLFD"].ToString();
            Result = Connect2Proxy(or1);
            if (Result.Tables.Count > 0)
            {
                tbLocal = Result.Tables[0];
                tbLocal.TableName = "VKKOPF";
            }
            Return.Merge(Result);
            return Return;
        }
        public DataSet QueryVKPOS(DataRow dwData)
        {
            DataSet Return = new DataSet();
            DataTable tbLocal = null;
            DataSet Result = new DataSet();
            string table = "VKPOS";
            try
            {
                or1 = OracleDB.CreateCommand();

                or1.CommandText = "SELECT * FROM VKPOS WHERE  "
                + "  VKPMANDANT=:VKPMANDANT AND VKPAUFKRS=:VKPAUFKRS AND VKPAUFLFD=:VKPAUFLFD AND VKPAUFPOS=:VKPAUFPOS";
                or1.Parameters.Add("VKPMANDANT", OracleType.NVarChar).Value = dwData["VKPMANDANT"].ToString();
                or1.Parameters.Add("VKPAUFKRS", OracleType.NVarChar).Value = dwData["VKPAUFKRS"].ToString();
                or1.Parameters.Add("VKPAUFLFD", OracleType.NVarChar).Value = dwData["VKPAUFLFD"].ToString();
                or1.Parameters.Add("VKPAUFPOS", OracleType.NVarChar).Value = dwData["VKPAUFPOS"].ToString();
                Result = Connect2Proxy(or1);
                if (Result.Tables.Count > 0)
                {
                    tbLocal = Result.Tables[0];
                    tbLocal.TableName = "VKPOS";
                }
                Return.Merge(Result);
            }
            catch (Exception ex)
            {
                Tracer.Error(ex.StackTrace, ex);
            }
            return Return;
        }
        public DataSet QueryVVLIEF(DataRow dwData)
        {
            DataSet Return = new DataSet();
            DataTable tbLocal = null;
            DataSet Result = new DataSet();
            string table = "VVLIEF";
            try
            {
                or1 = OracleDB.CreateCommand();

                or1.CommandText = "SELECT * FROM VVLIEF WHERE VVMANDANT=:VVMANDANT AND VVLIEFSCH=:VVLIEFSCH";
                or1.Parameters.Add("VVMANDANT", OracleType.NVarChar).Value = dwData["VVMANDANT"].ToString();
                or1.Parameters.Add("VVLIEFSCH", OracleType.NVarChar).Value = dwData["VVLIEFSCH"].ToString();
                Result = Connect2Proxy(or1);
                if (Result.Tables.Count > 0)
                {
                    tbLocal = Result.Tables[0];
                    tbLocal.TableName = "VVLIEF";
                }
                Return.Merge(Result);
            }
            catch (Exception ex)
            {
                Tracer.Error(ex.StackTrace, ex);
            }
            return Return;
        }
        public DataSet QueryVVTLIEF(DataRow dwData)
        {
            DataSet Return = new DataSet();
            DataTable tbLocal = null;
            DataSet Result = new DataSet();
            string table = "VVTLIEF";
            try
            {
                or1 = OracleDB.CreateCommand();

                or1.CommandText = "SELECT * FROM VVTLIEF WHERE VVTMANDANT=:VVTMANDANT AND VVTLIEFSCH=:VVTLIEFSCH AND VVTLIEFSCHPOS=:VVTLIEFSCHPOS";
                or1.Parameters.Add("VVTMANDANT", OracleType.NVarChar).Value = dwData["VVTMANDANT"].ToString();
                or1.Parameters.Add("VVTLIEFSCH", OracleType.NVarChar).Value = dwData["VVTLIEFSCH"].ToString();
                or1.Parameters.Add("VVTLIEFSCHPOS", OracleType.NVarChar).Value = dwData["VVTLIEFSCHPOS"].ToString();
                Result = Connect2Proxy(or1);
                if (Result.Tables.Count > 0)
                {
                    tbLocal = Result.Tables[0];
                    tbLocal.TableName = "VVTLIEF";
                }
                Return.Merge(Result);
            }
            catch (Exception ex)
            {
                Tracer.Error(ex.StackTrace, ex);
            }
            return Return;
        }

        //WDECK WBBST WBBEW VVLIEF VVTLIEF
        #endregion
    }
}
